<template>
  <div>
    <div class="menu">
      <div class="item">编号</div>
      <div class="item">姓名</div>
      <div class="item">年龄</div>
      <div class="item">操作</div>
    </div>
    <div class="menu" v-for="item in list" :key="item.id">
      <div class="item">{{ item.id }}</div>

      <div class="item">{{ item.name }}</div>
      <div class="item">{{ item.age }}</div>
      <div class="item" @click="del(item.id)">删除</div>
    </div>
  </div>
</template>

<script>
export default {
  props: ["list"],
  methods:{
    del(id){
        this.$emit("delListById",id);
    }
  }
};
</script>

<style scoped>
.menu {
}
.menu .item {
  background-color: skyblue !important;
}
</style>
